package domain.items;

import java.util.Vector;


public class Topic extends Item {

	/**
	 * keeps the sub items under this topic.
	 */
	private Vector<Item> _subItems;

	/**
	 * Constructor.
	 * @param father
	 */
	public Topic(Item father) {
		super(father);
		this._subItems = new Vector<Item>();
		this._type = Item.TOPIC;
	}

	/**
	 * getters.
	 */
	public Vector<Item> getSubItems(){
		return this._subItems;
	}

	public TopicPacket convertToPacket(){
		TopicPacket packet = new TopicPacket();
		packet.setName(this.getName());
		for (Item item : this._subItems) {
			packet.getSubItems().add(item.getName());
		}
		return packet;
	}


}
